﻿using System;
using System.CodeDom;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;

namespace doveData
{
    public abstract class BaseObj
    {
        public string Name;
        public string Id;
        public Vector2 Location;
        public override string ToString()
        {
            return Name;
        }

    }


    public class Station : BaseObj
    {
        public Dictionary<string, string> LineDict = new Dictionary<string, string>();//线路中对应的编号 key查询所属线路 value查询在线路中的索引
        //测试用


        #region 构造函数


        public Station(string stationId, string lineIndex, string stationIndex, string stationName,Vector2 location)
        {
            Id = stationId;
            LineDict.Add(lineIndex, stationIndex);
            Name = stationName;
            Location = location;
            //Debug();
        }


        #endregion

        public void Debug()
        {
            string lineInfo = "";
            foreach (var key in LineDict.Keys)
            {
                lineInfo += key + "号线" + LineDict[key] + "站——";
            }
            Console.WriteLine("id:{0},name:{1},Lines:{2}", Id, Name, lineInfo);
        }

        public override string ToString()
        {

                return Name;
            
        }
    }

    public class Hotel:BaseObj
    {
        public Hotel(string id,float stars, float score, float price,Vector2 location,string name)
        {
            Id = id;
            Name = name;
            Stars = stars;
            Score = score;
            Price = price;
            Location = location;
        }
        public float Stars;
        public float Score;
        public float Price;

      
    }

    public class Market : BaseObj
    {
        public Market(string id,float score, string goods,Vector2 location,string name)
        {
            Id = id;
            Name = name;
            Score = score;
            Goods = goods;
            Location = location;
        }

        public float Score;
        public string Goods;
        

    }

    public class Food : BaseObj
    {
        public Food(string id,float score, float price,Vector2 location,string name)
        {
            Id = id;
            Name = name;
            Score = score;
            Price = price;
            Location = location;
        }

        //public Food(object id,object name, object x, object y, object score, object price)
        //{
        //    Id = (string)id;
        //    Name = (string)name;
        //    Score = float.Parse(score.ToString());
        //    Price = float.Parse(price.ToString());
        //    Location = new Vector2(int.Parse(x.ToString()), int.Parse(y.ToString()));
        //}

        public float Score;
        public float Price;
    }
}
